#include <bits/stdc++.h>
using namespace std;
int n;
bool ys(int a) {
  if (a < 1)
    return 0;
  for (int i = 2; i * i <= a; i++) {
    if (a % i == 0) {
      return 0;
    }
  }
  return 1;
}
int main() {
  cin >> n;
  if (ys(n)) {
    cout << n;
    return 0;
  }
  int chu = 2;
  //   int k = sqrt(n) + 1;
  while (chu * chu <= n) {
    if (n % chu == 0) {
      cout << chu << " ";
      n /= chu;
    } else {
      chu++;
    }
  }

  if (n > 1)
    cout << n;

  return 0;
}